[feat] new azure-ai-agentserver-optimization package for load_config#47096
Open
Zyysurely wants to merge 5 commits into
Open
[feat] new azure-ai-agentserver-optimization package for load_config#47096Zyysurely wants to merge 5 commits into
Zyysurely wants to merge 5 commits into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR introduces a new azure-ai-agentserver-optimization package under sdk/agentserver/ that provides a single load_config() entry point for resolving hosted-agent optimization configuration from multiple sources (env inline JSON, resolver API, local directory, defaults), and wires the new package into the agentserver CI artifact list.
Changes:
- Added the new
azure-ai-agentserver-optimizationpackage (packaging metadata, README, changelog, namespace package files, and typed implementation for config loading + resolver API persistence). - Implemented config resolution logic (
_config.py), models/parsers (_models.py), and remote candidate resolution/persistence (_resolver.py). - Added a comprehensive unit test suite for resolution priorities, parsing, persistence, and resolver behavior; updated
sdk/agentserver/ci.ymlto include the new artifact.
Reviewed changes
Copilot reviewed 18 out of 19 changed files in this pull request and generated 13 comments.
Show a summary per file
| File | Description |
|---|---|
| sdk/agentserver/ci.yml | Adds azure-ai-agentserver-optimization to CI artifacts for the agentserver service directory. |
| sdk/agentserver/azure-ai-agentserver-optimization/README.md | New package README describing load_config(), env vars, file layout, and formats. |
| sdk/agentserver/azure-ai-agentserver-optimization/pyproject.toml | New package build metadata, dependencies, classifiers, and azure-sdk-build settings. |
| sdk/agentserver/azure-ai-agentserver-optimization/MANIFEST.in | sdist manifest entries (docs, license, tests, namespace files, py.typed). |
| sdk/agentserver/azure-ai-agentserver-optimization/LICENSE | MIT license for the new package. |
| sdk/agentserver/azure-ai-agentserver-optimization/dev_requirements.txt | Dev/test requirements for the new package. |
| sdk/agentserver/azure-ai-agentserver-optimization/CHANGELOG.md | Initial release notes for the new package. |
| sdk/agentserver/azure-ai-agentserver-optimization/azure/init.py | Namespace package marker for azure. |
| sdk/agentserver/azure-ai-agentserver-optimization/azure/ai/init.py | Namespace package marker for azure.ai. |
| sdk/agentserver/azure-ai-agentserver-optimization/azure/ai/agentserver/init.py | Namespace package marker for azure.ai.agentserver. |
| sdk/agentserver/azure-ai-agentserver-optimization/azure/ai/agentserver/optimization/init.py | Public API exports (load_config, models) and module docstring. |
| sdk/agentserver/azure-ai-agentserver-optimization/azure/ai/agentserver/optimization/_version.py | Declares package version. |
| sdk/agentserver/azure-ai-agentserver-optimization/azure/ai/agentserver/optimization/_models.py | Dataclasses (OptimizationConfig, etc.) and parsing helpers. |
| sdk/agentserver/azure-ai-agentserver-optimization/azure/ai/agentserver/optimization/_config.py | load_config() implementation + local directory loading/parsing. |
| sdk/agentserver/azure-ai-agentserver-optimization/azure/ai/agentserver/optimization/_resolver.py | Remote resolver API calls and persistence to local layout. |
| sdk/agentserver/azure-ai-agentserver-optimization/azure/ai/agentserver/optimization/py.typed | Enables PEP 561 typing for the package. |
| sdk/agentserver/azure-ai-agentserver-optimization/tests/conftest.py | Test-wide env var cleanup fixture. |
| sdk/agentserver/azure-ai-agentserver-optimization/tests/test_config.py | Unit tests for load_config() resolution and parsing helpers. |
| sdk/agentserver/azure-ai-agentserver-optimization/tests/test_resolver.py | Unit tests for resolver API behavior and persistence helpers. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
azure-ai-agentserver-optimization— Initial beta release (1.0.0b1)Summary
Adds a new package
azure-ai-agentserver-optimizationthat provides a drop-in config loader for optimization-ready Azure AI Hosted Agents. A singleload_config()call resolves optimization parameters (instructions, model, temperature, skills, tool definitions) from multiple sources with graceful fallback — the agent works unchanged when not running under optimization.What's included
Public API:
load_config(*, config_dir, required)— 4-priority config resolution with graceful fallbackload_skills_from_dir(path)— load skills from a directory ofSKILL.mdfiles on demandOptimizationConfig— resolved config dataclass (instructions, model, temperature, skills, skills_dir, tool_definitions, source, candidate_id)OptimizationConfig.apply_tool_descriptions(tools)— patch__doc__,.description, andinput_modelparameter descriptions on @tool-decorated functionsOptimizationConfig.compose_instructions()— append skill catalog to instructionsCandidateConfig/Skill— typed models for API payload and learned skillsResolution order (first match wins):
OPTIMIZATION_CONFIGenv var (used by temp agent versions during eval)OPTIMIZATION_CANDIDATE_ID+OPTIMIZATION_RESOLVE_ENDPOINT→ fetches config, persists to local layoutconfig_dirparam /OPTIMIZATION_LOCAL_DIRenv var /.agent_configs/default → readsmetadata.yaml+instructions.md+tools.json+skills/required=TrueraisesValueError;required=FalsereturnsNoneKey design decisions:
baseline/as required fallback,<candidate_id>/folders for optimization candidatesazure-corePipelineClientfor HTTP transport withDefaultAzureCredentialauthFiles
azure/ai/agentserver/optimization/_config.py— config loader with 4-priority resolutionazure/ai/agentserver/optimization/_models.py— data models (OptimizationConfig, CandidateConfig, Skill, MetadataConfig)azure/ai/agentserver/optimization/_resolver.py— resolver API client with local persistencetests/test_config.py,test_resolver.py,test_integration.py— 183 tests